package com.parktech.sun.domain.model.sunhz;

import com.parktech.sun.domain.model.BaseEntity;
import com.parktech.sun.domain.model.ContentEntity;

import javax.persistence.*;
import java.util.List;

/**
 * User: Think
 * Date: 2010-12-20
 * Time: 1:32:02
 */
@Entity
@DiscriminatorValue("100")
public class Application extends ContentEntity {

    private String imageName;

    private List<ApplicationAttachment> attachmentList;

    public String getImageName() {
        return imageName;
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    @OneToMany(fetch= FetchType.LAZY, mappedBy = "application", cascade = CascadeType.ALL)
    public List<ApplicationAttachment> getAttachmentList() {
        return attachmentList;
    }

    public void setAttachmentList(List<ApplicationAttachment> attachmentList) {
        this.attachmentList = attachmentList;
    }

    @Transient
    public String getLocation() {
        return "applications";
    }
}
